跳到主要内容

SetSpacing

Sets the text spacing measured in twentieths of a point.

Syntax

expression.SetSpacing(nSpacing);

expression - A variable that represents a ApiTextPr class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nSpacingRequiredtwipsThe value of the text spacing measured in twentieths of a point (1/1440 of an inch).

Returns

ApiTextPr

Example

This example sets the text spacing measured in twentieths of a point.

let doc = Api.GetDocument();
let textPr = doc.GetDefaultTextPr();
textPr.SetSpacing(80);
let paragraph = doc.GetElement(0);
paragraph.AddText("A sample text with the spacing set to 4 points (80 twentieths of a point).");